<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2016/11/9
 * Time: 15:56
 * Project name: PHPTEST
 * File name: 2.php
 * @copyright Copyright (c) 2016 ZRX Software LLC
 * @license https://github.com/zhangrxiang
 * @since 1.0.0
 */
include_once 'fun.php';




br("chop() 函数移除字符串右侧的空白字符或其他预定义字符。");
$str = "Hello World!     ";
echo $str . "<br>";
echo chop($str,"World!");

br();
br("bin2hex() 函数把 ASCII 字符的字符串转换为十六进制值。字符串可通过使用 pack() 函数再转换回去。");
$str = hex2bin(bin2hex("test"));
echo($str);
br();
br("bin2hex() 函数把 ASCII 字符的字符串转换为十六进制值。字符串可通过使用 pack() 函数再转换回去。");
$str = bin2hex("Hello World!");
echo($str);
br();

br("addslashes() 函数返回在预定义的字符前添加反斜杠的字符串。");
$str = addslashes('What does "yolo" mean? null \ <abbr>');
echo($str);
br();

br("addcslashes() 函数返回在指定的字符前添加反斜杠的字符串。");
$str = "Welcome to my humble Homepage!";
echo $str."<br>";
echo addcslashes($str,'m')."<br>";
echo addcslashes($str,'H')."<br>";

